
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:components="http://java.sun.com/jsf/composite/components"
      >
    <h:head>
        <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
        <script src="https://code.jquery.com/jquery.js"></script>
        <!-- Include all compiled plugins (below), or include individual files as needed -->
        <h:outputScript library="js" name="bootstrap.min.js" />
        <h1 align="center">
            <h:outputText value="Domótica - ML SQ" class="label label-primary" />
        </h1>
    </h:head>

    <h:body>
        <components:navbar />
        <h:form id="newAlertForm">
            <h:panelGrid id="panel" columns="6" border="0" cellpadding="5" cellspacing="5">
                
                <h:outputLabel id="lblNome" value="#{messages.NOME}" class="navbar-text" />
                <h:selectOneMenu value="#{newAlertBean.nome}">
                    <f:selectItems value="#{alertsBean.allNames}"/>
                </h:selectOneMenu>

                <h:outputLabel id="lblDescricao" value="#{messages.DESCRICAO}" class="navbar-text" />
                <h:inputText id="descricao" value="#{newAlertBean.descricao}" size="15" requiredMessage="Obrigatório" required="true" class="form-control"/>


                <h:outputLabel id="lblDiaSemana" value="#{messages.DIASEMANA}" class="navbar-text" />
                <h:selectOneMenu value="#{newAlertBean.diaSemana}">
                    <f:selectItems value="#{alertsBean.allDiasSemana}"/>
                </h:selectOneMenu>

                <h:outputLabel id="lblHora" value="#{messages.HORA}" class="navbar-text" />
                <h:inputText id="hora" value="#{newAlertBean.hora}" size="5" requiredMessage="Obrigatório" required="true" class="form-control"/>
                
                <h:outputLabel id="lblHoraFim" value="#{messages.HORAFIM}" class="navbar-text" />
                <h:inputText id="horaFim" value="#{newAlertBean.horaFim}" size="5" requiredMessage="Obrigatório" required="true" class="form-control"/>

                <h:outputLabel id="lblActivo" value="#{messages.ACTIVO}" class="navbar-text" />
                <h:selectBooleanCheckbox value="#{newAlertBean.activo}" />

                <h:outputLabel id="lblVoiceAlert" value="#{messages.VOICEALERT}" class="navbar-text" />
                <h:selectBooleanCheckbox value="#{newAlertBean.voiceAlert}" />

                <h:commandButton id="submit" value="#{messages.SAVE}" action="#{newAlertBean.saveAlert}" class="btn btn-default" />
            </h:panelGrid>
            <components:tabelaAlerts />
        </h:form>
    </h:body>

</html>